package com.ruoyi.api.activiti.listener;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.springframework.stereotype.Service;

@Service("taskCompleteListener")
public class TaskCompleteListener implements TaskListener {
  @Override
  public void notify(DelegateTask delegateTask) {
    System.out.println(delegateTask);
    String eventName = delegateTask.getEventName();
    if (eventName.equalsIgnoreCase("start")) {
      System.out.println("===create==" + delegateTask.getVariables());
    } else if (eventName.equalsIgnoreCase(TaskListener.EVENTNAME_COMPLETE)) {
      System.out.println("===complete==" + delegateTask.getVariables());
    }
  }
}
